package cn.crm.bean;

import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.SEQUENCE;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.SequenceGenerator;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Appointement entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "AM_APPOINTEMENT")
public class Appointement implements java.io.Serializable {

	// Fields

	private Integer amAid;
	private DDL DDL;
	private AddressBook addressBook;
	private User user;
	private Date amAtime;
	private String amOther;

	// Constructors

	/** default constructor */
	public Appointement() {
	}

	/** full constructor */
	public Appointement(DDL DDL, AddressBook addressBook, User user,
			Date amAtime, String amOther) {
		this.DDL = DDL;
		this.addressBook = addressBook;
		this.user = user;
		this.amAtime = amAtime;
		this.amOther = amOther;
	}

	// Property accessors
	@SequenceGenerator(name = "generator",sequenceName="seq_appointement_aid")
	@Id
	@GeneratedValue(strategy = SEQUENCE, generator = "generator")
	@Column(name = "AM_AID", unique = true, nullable = false, precision = 6, scale = 0)
	public Integer getAmAid() {
		return this.amAid;
	}

	public void setAmAid(Integer amAid) {
		this.amAid = amAid;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "TYPE_ISOK")
	public DDL getDDL() {
		return this.DDL;
	}

	public void setDDL(DDL DDL) {
		this.DDL = DDL;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "AB_CONTACT")
	public AddressBook getAddressBook() {
		return this.addressBook;
	}

	public void setAddressBook(AddressBook addressBook) {
		this.addressBook = addressBook;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "US_EMPID")
	public User getUser() {
		return this.user;
	}

	public void setUser(User user) {
		this.user = user;
	}

	@Temporal(TemporalType.DATE)
	@Column(name = "AM_ATIME", length = 7)
	public Date getAmAtime() {
		return this.amAtime;
	}

	public void setAmAtime(Date amAtime) {
		this.amAtime = amAtime;
	}

	@Column(name = "AM_OTHER", length = 50)
	public String getAmOther() {
		return this.amOther;
	}

	public void setAmOther(String amOther) {
		this.amOther = amOther;
	}

}